<template>
    <div>
        <el-button type="primary">添加</el-button>
        <el-button  plain border="0">返回</el-button>
        <!-- <el-row>
            <el-col :span="4"><el-button type="primary">添加</el-button></el-col>
            <el-col :span="4"><el-button  plain border="0">返回</el-button></el-col>
            <el-col :span="4"></el-col>
            <el-col :span="4"></el-col>
            <el-col :span="4"></el-col>
            <el-col :span="4"></el-col>
        </el-row> -->

        <el-table :data="tableData" stripe border style="width: 100%">
            <el-table-column prop="check_date" label="检测时间"  width="180">
            </el-table-column>
            <el-table-column  prop="HS_end" label="核酸结果" align="center"></el-table-column>
            <el-table-column prop="CT_end" label="CT结果" align="center"></el-table-column>
            <el-table-column prop="cz" label="操作">
                <el-button  size="mini"  type="danger"  @click="delite">删除</el-button> 
            </el-table-column>
        </el-table>
        <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage4"
            :page-sizes="[100, 200, 300, 400]"
            :page-size="100"
            layout="total, sizes, prev, pager, next, jumper"
            :total="400">
        </el-pagination>
    </div>
</template>
<script>
import request from '@/utils/request'
    export default {
    methods: { 
      fetchData(){
          request({
              url:'../management_2.json',
              method:'get'
          }).then(response => {
              this.tableData = response.data
          })
      },
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
      },
     delite() {
        this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });          
        });
      },
      },
    data() {
            return {   
              
                tableData: null,
                check_date: '',
                HS_end: '',
                CT_end: '',
                
                currentPage1: 5,
                currentPage2: 5,
                currentPage3: 5,
                currentPage4: 4,  
                // tableData: [{
                // check_date: '2016-05-02',
                // HS_end: '阴',
                // CT_end: '阴',
                // cz: ''
                // }, {
                // check_date: '2016-05-02',
                // HS_end: '阴',
                // CT_end: '阴',
                // cz: ''
                // }, {
                // check_date: '2016-05-02',
                // HS_end: '阴',
                // CT_end: '阴',
                // cz: ''
                // }, {
                // check_date: '2016-05-02',
                // HS_end: '阴',
                // CT_end: '阴',
                // cz: ''
                // }]
            }
        },
    created(){
      this.fetchData()
    //   this.alter()
  },
}
</script>